package com.wanmait.recruitment.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruitment.mapper.ResumeMapper;
import com.wanmait.recruitment.pojo.Resume;
import com.wanmait.recruitment.service.ResumeService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ResumeServiceImpl implements ResumeService {

    @Resource
    ResumeMapper resumeMapper;


    @Override
    public void insert(Resume resume) {

    }

    @Override
    @CacheEvict(value = "resumeCache",allEntries = true)
    public void insert(Integer userinfoId, String name, Integer exId) {

        resumeMapper.insertResume(userinfoId,name,exId);

    }


    @Override
    public void insert(Object object) {

    }
    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Object object) {

    }


    @Override
    public void update(Object object, Integer id) {

    }

    @Override
    public Resume findByResumeId(Integer id) {
        return resumeMapper.findById(id);
    }

    @Override
    @CacheEvict(value = "resumeCache",allEntries = true)
    public  Object update(Resume resume, Integer id){
        return  resumeMapper.updateResumes(resume,id);

    }

    @Override
    public Object insert(Resume resume, Integer id) {
        return null;
    }


    @Override
    public Resume findById(Integer id) {
        return resumeMapper.selectById(id);
    }

    @Override
    public  int dataCountResume(Integer id){
        return resumeMapper.dataCountResume(id);
    }
    @Override
    public  int dataCountWorkEx(Integer id){
        return  resumeMapper.dataCountWorkEx(id);

    }
    @Override
    public int dataCountItemEx(Integer id){
        return  resumeMapper.dataCountItemEx(id);
    }
    @Override
    public  int dataCountEducation(Integer id){

        return  resumeMapper.dataCountEducation(id);
    }
    @Override
    public  int dataCountWorksShow(Integer id){

        return  resumeMapper.dataCountWorksShow(id);

    }
    @Override
    public  void updateResumeName(String name,Integer id){

            resumeMapper.updateResumeName(name,id);

    }
    @Override
    public  Object updateWorkExId(Integer count, Integer id){

        return  resumeMapper.updateWorkExId(count,id);
    }
    @Override

    public  Object updateWorksShowId(Integer count,Integer id){

        return  resumeMapper.updateWorksShowId(count,id);
    }
    @Override
    public  Object updateTiemExId(Integer count, Integer id){

        return  resumeMapper.updateItemExId(count,id);

    }
    @Override
    public  Object updateEducationId(Integer count, Integer id){

        return  resumeMapper.updateEducationId(count,id);

    }
    @Override
    public Object uptedateResume(Resume resume,Integer id){

        return resumeMapper.updateResume(resume,id);
    }
    @Override
    public  Object updateEducation(Resume resume,Integer id){
        return resumeMapper.updateEducation(resume,id);

    }
    @Override
    public  Object updateSelf(String slef, Integer id){
        return resumeMapper.updateSelfIntroduction(slef,id);

    }
    @Override
    public  Object updateWorksShow(Resume resume, Integer id){
        return  resumeMapper.updateWorksShow(resume,id);
    }
    @Override
    public Object updateWorkEx(Resume resume, Integer id){
        return  resumeMapper.updateWorkEx(resume,id);

    }
    @Override
    public  Object updateItemEx(Resume resume, Integer id){
        return  resumeMapper.updateItemEx(resume,id);

    }

    @Override
    public List findAll() {
        return null;
    }

    @Override
    public List findAll(Object object) {
        return null;
    }


    @Override
    public PageInfo findPage(int pageNum, int pageSize) {
        return null;
    }

    @Override
    @Cacheable("resumeCache")
    public List<Resume> findByUserinfoId(Integer userinfoId) {
        return resumeMapper.selectByUserinfoId(userinfoId);
    }
    @Override
    public  Resume   findAllByIdResume(Integer id){

        return  resumeMapper.selectResumeByIdAll(id);

    }
    @Override
    public  List<Resume>selectHopeJobById(Integer id){
         return resumeMapper.selectHopeJobById(id);
    }
    @Override
    public  List<Resume>selectWorkExById(Integer id){
        return  resumeMapper.selectWrokExById(id);
    }
    @Override
    public  List<Resume>selectItemEXById(Integer id){
        return resumeMapper.selectItemExById(id);
    }
    @Override
    public  List<Resume>selectEducationById(Integer id){
        return  resumeMapper.selectEductionById(id);
    }

}


